<html>
    <head>
        <title>Đề án</title>
        <meta http-equiv="content-type" content="text/html; charset = utf-8" />
        <link rel="stylesheet" type="text/css" href="../style.css" />
        <script lang="javascript">
            
        </script>

    </head>
    <body>
    <div id="wrap">
        <?php
	       include "../include/header.php";
           include "../include/mod_menu_admin.php";
                if(!isset($_SESSION["userlogin"])|| $_SESSION["vaitro"]=="Quản Trị"){
                $_SESSION['thongbao']= "Bạn vui lòng đăng nhập theo đúng quy trình. Xin cám ơn!";
                header("location:../index.php");
                }            
        ?>
        <div id="content">
            <div id="colleft">
                <?php
                    include "../include/mod_idbox.php";
                    include "../include/mod_thongbao.php";
                    include "../include/mod_search.php";

                ?>
            </div>
                
            <div id="colright">

                <?php
                 
                    include "../util/datautil.php";
                    include "../controller/nhanVienController.php";
                    include "../controller/vaiTroController.php";
                    include "../controller/phongBanController.php";
                    include "../controller/tinhTrangController.php";
                     
                    
                    
                    while ($row = mysql_fetch_array($nhanVien1)) {
                        $id_NhanVien = $row["id_NhanVien"];
                        $matKhau = $row["MatKhau"];
                        $tenVaiTro = $row["TenVaiTro"];
                        $tenPhong = $row["TenPhong"];
                        $tinhTrang = $row["TinhTrang"];
                        $maNQL = $row["MaNQL"];
                        $hoTen = $row["HoTen"];
                        $gioiTinh = $row["GioiTinh"];
                        $ngaySinh = $row["NgaySinh"];
                        $noiSinh = $row["NoiSinh"];
                        $diaChi = $row["DiaChi"];
                        $dienThoai = $row["DenThoai"];
                        $email = $row["Email"];
                        $ngayBDLV = $row["NgayBDLV"];
                        $luong = $row["Luong"];
                        $ghiChu = $row["GhiChu"];
                    }
                 
                ?>
            
                <div id="caidat">
                    <div class="formHeader">
                        <p>Cập nhật thông tin nhân viên</p>
                    </div>
                    
                    <div id="formContent">
                        <form action="" method="post" id="frm_EditNhanVien" name="frm_EditNhanVien">
                            <table cellspacing = 0 cellpadding =0>
                                <input type="hidden" name="actionType" value="getTT" />
                                
                                <tr>
                                    <td align="right">Mã Nhân Viên</td>
                                                        
                                    <td>
                                    <input type="text" size="30" id="id_NhanVien" name="id_NhanVien" value="<?php echo $id_NhanVien; ?>" />
                                    </td>                                
                                </tr>
                
                                <tr>
                                    <td align="right">Mật Khẩu</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtMK" name="txtMK" value="<?php echo $matKhau; ?>" />
                                    </td>                                    
                                </tr>
                
                                <tr>
                                    <td align="right">Họ Tên</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtHoTen" name="txtHoTen" value="<?php echo $hoTen; ?>" />
                                    </td>                                    
                                </tr>
                                    
                                   
                                <tr>
                                    <td align="right">Giới Tính</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtGioiTinh" name="txtGioiTinh" value="<?php echo $gioiTinh; ?>" />
                                    </td>                                  
                                </tr>
                                    
                                <tr>
                                    <td align="right">Ngày Sinh</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtNgaySinh" name="txtNgaySinh" value="<?php echo $ngaySinh; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Nơi Sinh</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtNoiSinh" name="txtNoiSinh" value="<?php echo $noiSinh; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Địa Chỉ</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtDiaChi" name="txtDiaChi" value="<?php echo $diaChi; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Điện Thoại</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtDienThoai" name="txtDienThoai" value="<?php echo $dienThoai; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Email</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtEmail" name="txtEmail" value="<?php echo $email; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Ngày BDLV</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtNgayBDLV" name="txtNgayBDLV" value="<?php echo $ngayBDLV; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Vai Trò</td>
                                                            
                                    <td>
                                        <select id="cboVaiTro" name="cboVaiTro">
                                            <?php
                                                while($row = mysql_fetch_array($vaiTro)){
                                                    echo "<option value='".$row[id]."'>". $row["TenVaiTro"]."</option>";
                                                }
                                            ?>
                                        </select>
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Phòng Ban</td>
                                                            
                                    <td>
                                        <select id="cboPhong" name="cboPhong">
                                            <?php
                                                while($row = mysql_fetch_array($phongBan)){
                                                    echo "<option value='".$row["MaPhong"]."'>". $row["TenPhong"]."</option>";
                                                }
                                            ?>
                                        </select>
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Tình Trạng</td>
                                                            
                                    <td>
                                        <select id="cboTT" name="cboTT">
                                            <?php
                                                while($row = mysql_fetch_array($tinhTrang)){
                                                    echo "<option value='".$row["id"]."'>". $row["TinhTrang"]."</option>";
                                                }
                                            ?>
                                        </select>
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Mã NQL</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtMaNQL" name="txtMaNQL" value="<?php echo $maNQL; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Luong</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtLuong" name="txtLuong" value="<?php echo $luong; ?>" />
                                    </td>                
                                </tr>
                                
                                <tr>
                                    <td align="right">Ghi Chú</td>
                                                            
                                    <td>
                                        <input type="text" size="30" id="txtGhiChu" name="txtGhiChu" value="<?php echo $ghiChu; ?>" />
                                    </td>                
                                </tr>
                                    
                                <tr>
                                    <td colspan="3" align ="center">
                                        <input type="submit" value="Lưu Lại" id="capNhat" name="capNhat"/>
                                        <input type="reset" value="Nhập Lại" id="nhapLai" name="nhapLai" onclick="clearTextbox();" />
                                    </td>
                                </tr>
                                    
                            </table>
                        </form>
                    </div>
                </div>
            
                <div class="statusindex">
                    <p> <?php echo $_SESSION['thongbao']; unset ($_SESSION['thongbao']);  ?></p>
                </div>
            
            </div>
            
            <div class="clear"></div>
        </div><!--end content-->
            <?php
                include "../include/footer.php";
                
            ?>
        
    </div><!--end wrap-->        
    </body>
</html>